package com.llb666.shop.items.domain.entity.es;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

/**
 * es商品信息查询对象.
 *
 * @author llb666
 */
@Document(indexName = "mall-items", shards = 1, replicas = 1, createIndex = false)
@Data
public class EsItems {

    /**
     * 商品Id
     */
    @Id
    @Field(store = true, type = FieldType.Text, index = false)
    private String itemId;

    /**
     * 商品名称
     */
    @Field(store = true,type = FieldType.Text,fielddata = true)
    private String itemName;

    /**
     * 商品图片
     */
    @Field(store = true,type = FieldType.Text,index = false)
    private String imgUrl;

    /**
     * 价格
     */
    @Field(store = true, type = FieldType.Integer)
    private Integer price;

    /**
     * 销量
     */
    @Field(store = true, type = FieldType.Integer)
    private Integer sellCounts;

    /**
     * 一级分类id
     */
    @Field(store = true, type = FieldType.Integer)
    private Integer rootCatId;
}
